#include <stdio.h>
#include <stdbool.h>

bool isPowerOfTwo(int n) 
{
    return (n & (n-1));
}
int main()
{
    int n = 0;
    printf("请输入n的值：\n");
    scanf("%d",&n); 
    if(isPowerOfTwo(n) == 0)
        printf("%d是2的幂\n",n);
    else
        printf("%d不是2的幂\n",n);

    return 0;
}